package com.six.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * ClassName:Swagger3Config
 * Package:com.six.config
 * Description
 *
 * @Author:@wenxueshi
 * @Create:2023/7/3 - 23:57
 * @Version:v1.0
 */
@Configuration
@EnableOpenApi // 开始swagger3
@EnableKnife4j // 开启knife4j
public class Swagger3Config {
    @Bean
    public Docket systemDocket() {
        return new Docket(DocumentationType.OAS_30)
                .groupName("Minio测试")
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.six.controller"))
                .paths(PathSelectors.any())
                .build();
    }

   /* @Bean
    public Docket monitorDocket() {
        return new Docket(DocumentationType.OAS_30)
                .groupName("系统监控")
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.huaxiaozhuo.admin.modules.monitor.controller"))
                .paths(PathSelectors.any())
                .build();
    }*/

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("sixKey Minio测试文档")
                .description("集成swagger3")
                .version("1.0.0")
                .contact(new Contact("sixKey GITEE", "https://gitee.com/six-key", "2073958890@qq.com"))
                .termsOfServiceUrl("http://www.sixkey-world.top")
                .build();
    }
}
